package com.bw.ivideoproject.home

import com.bw.ivideoproject.db.entity.HistoryEntity
import com.bw.ivideoproject.entity.BaseResp
import com.bw.ivideoproject.entity.CommentEntity
import com.bw.ivideoproject.entity.SimpleVideoEntity
import com.bw.ivideoproject.entity.SimpleVideoTypeEntity
import com.bw.lib_internet.BaseApi
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface HomeApi : BaseApi {

    @GET("/videotype/getSimpleType")
    suspend fun getSimpleVideoType():BaseResp<List<SimpleVideoTypeEntity>>

    @GET("/videosimple/getSimpleVideoByChannelId")
    suspend fun getSimpleVideo(@Query("channelId") channelId:String,@Query("page") page:Int,@Query("pagesize") pageSize:Int):BaseResp<List<SimpleVideoEntity>>

    @GET("/videosimple/getRecommendSimpleVideo")
    suspend fun getRecommendVideo(@Query("page") page:Int,@Query("pagesize") pageSize:Int):BaseResp<List<SimpleVideoEntity>>

    @GET("/comment/getCommentByUserId")
    suspend fun getComment(@Query("datatype") datatype:Int,@Query("itemid") itemId:String):BaseResp<List<CommentEntity>>

    @POST("/comment/publishComment")
    suspend fun sendComment(@Body entity: CommentEntity):BaseResp<CommentEntity>

    @GET("/videosimple/getSimpleVideoByKeyword")
    suspend fun getVideoByKeyword(@Query("keyword") keyword:String,@Query("page") page:Int,@Query("pagesize") pageSize:Int):BaseResp<List<SimpleVideoEntity>>
}